IsNotLongerOrEqual(TCollection) Method (ConditionValidator(TCollection), Int32)

CuttingEdge.Conditions

Checks whether the number of elements in the given value, is not more than and not equal to the specified numberOfElements argument. An exception is thrown otherwise. When the value is a null reference, it is considered to have 0 elements.

Namespace:  CuttingEdge.Conditions
Assembly:  CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function IsNotLongerOrEqual(Of TCollection As IEnumerable) ( _
	validator As ConditionValidator(Of TCollection), _
	numberOfElements As Integer _
) As ConditionValidator(Of TCollection)
C#
public static ConditionValidator<TCollection> IsNotLongerOrEqual<TCollection>(
	ConditionValidator<TCollection> validator,
	int numberOfElements
)
where TCollection : IEnumerable
Visual C++
public:
generic<typename TCollection>
where TCollection : IEnumerable
static ConditionValidator<TCollection>^ IsNotLongerOrEqual(
	ConditionValidator<TCollection>^ validator, 
	int numberOfElements
)
JavaScript
JavaScript does not support generic types or methods.

Parameters

validator
Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(TCollection>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
numberOfElements
Type: System..::.Int32
The collection must contain less elements than this value.

Type Parameters

TCollection
The type of the value to check.

Return Value

The specified validator instance.

Exceptions

ExceptionCondition
System..::.ArgumentExceptionThrown when the Value of the specified validator contains more or the same amount of elements as specified by the numberOfElements argument, while the specified validator is created using the Requires extension method.
System..::.ArgumentNullExceptionThrown when the Value of the specified validator is a null reference and the numberOfElements is smaller or equal to 0, while the specified validator is created using the Requires extension method.
CuttingEdge.Conditions..::.PostconditionExceptionThrown when the Value of the specified validator contains more or the same amount of elements as specified by the numberOfElements argument, while the specified validator is created using the Ensures extension method.

See Also